package com.ruoyi.consumer.mapper;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.consumer.domain.PaymentRecord;
import com.ruoyi.consumer.domain.TPaymentHy;
import com.ruoyi.consumer.domain.VPaymentHy;
import com.ruoyi.consumer.domain.query.TPaymentHyQuery;
import com.ruoyi.consumer.domain.query.VPaymentHyQuery;

import java.util.List;

/**
 * 缴费记录
 * @author lisongtao
 * @date 2023/11/2 9:46
 */
public interface PaymentHyMapper {


    /**
     * 根据房间编号和年份查询付费记录
     */
    @DataSource(value = DataSourceType.SLAVE)
    List<VPaymentHy> selectVPaymentHyByParam(VPaymentHyQuery vPaymentHyQuery);

    /**
     * 根据缴费计划id查询缴费情况
     */
    @DataSource(value = DataSourceType.SLAVE)
    VPaymentHy selectVPaymentHyByPlanId(VPaymentHyQuery vPaymentHyQuery);

    /**
     * 根据房源编号查询付费记录
     */
    @DataSource(value = DataSourceType.SLAVE)
    List<TPaymentHy> selectTPaymentHyByParam(TPaymentHyQuery tPaymentHyQuery);


    /**
     * 修改T_Room_hy表支付成功状态
     */
    @DataSource(value = DataSourceType.SLAVE)
    int updateRoomHyByRoomId(PaymentRecord paymentRecord);

    /**
     * 微信支付成功更新T_Plan_hy表
     */
    @DataSource(value = DataSourceType.SLAVE)
    int updatePlanHyByPlanId(String planId);

    /**
     * T_Payment_hy插入支付成功记录
     */
    @DataSource(value = DataSourceType.SLAVE)
    int insertPaymentHy(PaymentRecord paymentRecord);
}
